package com.learn.sunday.fegin.config;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.EnvironmentAware;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

/**
 * ll
 * @projectName: sunday
 * @package: com.learn.sunday.fegin.config
 * @className: ProjectNameconfig
 * @author: MasterYi
 * @description: TODO
 * @date: 2023/11/14 23:09
 * @version: 1.0
 */
@Configuration
public class ProjectNameConfig implements EnvironmentAware {

    @Value("${spring.application.name}")
    private String applicationName;
    @Override
    public void setEnvironment(Environment environment) {
        if (StringUtils.isBlank(System.getProperty("project.name"))) {
            System.setProperty("project.name",applicationName);
        }
    }
}
